package com.example.sls.controller.social;

import com.example.sls.pojo.social.UserGroups;
import com.example.sls.service.intserfaces.social.UserGroupsService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 用户群组表(UserGroups)表控制层
 *
 * @author 蓝江富
 * @since 2024-06-19 13:23:43
 */
@RestController
@RequestMapping("social/userGroups")
public class UserGroupsController {
  @Autowired
  UserGroupsService userGroupsService;

  @GetMapping("queryById")
  UserGroups queryById(Integer id) {
    return userGroupsService.queryById(id);
  }

  @GetMapping("queryAllByLimit")
  List<UserGroups> queryAllByLimit(UserGroups userGroups, Integer pageSize, Integer offset) {
    return userGroupsService.queryAllByLimit(userGroups, pageSize, offset);
  }

  @GetMapping("count")
  long count() {
    return userGroupsService.count();
  }

  @GetMapping("insert")
  int insert(UserGroups userGroups) {
    return userGroupsService.insert(userGroups);
  }

  @GetMapping("update")
  int update(UserGroups userGroups) {
    return userGroupsService.update(userGroups);
  }

  @GetMapping("deleteById")
  int deleteById(Integer id) {
    return userGroupsService.deleteById(id);
  }
}

